<template>
	<view>
		<form action="">
			<view class="item">
				<label for="">手机号:</label>
				<input type="text" id="" name="phone" placeholder="请输入手机号" />
			</view>
			<view class="item">
				<label for="">密&nbsp;&nbsp;&nbsp;码:</label>
				<input type="text" id="" name="password" placeholder="请输入密码" />
			</view>
		</form>
		<view class="button">
			<button type="submit" @click="regFn()">注册</button>
			<button type="reset">重置</button>
		</view>
	</view>
	<view class="">
		已注册？<button @click="uni.navigateBack();">去登录页</button>
	</view>
</template>

<script setup>
import loginVue from '../login/login.vue';

	function regFn(){
		uni.request({
			url:"http://47.94.6.186:3001/api/user/reg",
			method:'POST',
			data:{
				loginname:'',
				password:''
			},
			success(res) {
				console.log(res.data);
				uni.navigateTo({
					url:"/pages/login/login"
				})
			}
		})
	}
</script>

<style scoped>
	label {
		width: 70px;
	}

	.item {
		display: flex;
		margin: 10px;
	}

	input {
		line-height: 40px;
		border: 1px solid;
	}
	.button{
		display: flex;
	}
</style>